package com.steven.design.JieGou_Pattern.daili.jingtai;

import com.steven.design.JieGou_Pattern.daili.CommonMan;
import com.steven.design.JieGou_Pattern.daili.Man;

public class ManProxy implements Man {
    private CommonMan commonMan;

    public ManProxy(CommonMan commonMan){
        this.commonMan=commonMan;
    }
    @Override
    public void eat() {
        System.out.println("吃之前喝点酒");
        commonMan.eat();
        System.out.println("吃完之后聊天");
    }

    @Override
    public void sleep() {
        System.out.println("睡之前玩手机");
        commonMan.sleep();
    }
}
